package com.fortune.utils;

import com.faneui.common.exception.BusinessException;
import com.faneui.common.utils.DateFormatUtils;

import java.util.Calendar;
import java.util.Date;

public class DateUtils {

    public static String getNextMonthDate(String occurDate) throws BusinessException  {
        Calendar calendar = Calendar.getInstance();
        String nextDate = null ;
        try {
            Date date = DateFormatUtils.yyyyMMdd.parse(occurDate) ;
            calendar.setTime(date);
            calendar.add(Calendar.MONTH,1);
            nextDate = DateFormatUtils.yyyyMMdd.format(calendar.getTime()) ;
        }catch (Exception ex) {
            BusinessException.throwBusinessException(ex);
        }
        return nextDate;
    }

}
